<!DOCTYPE html>
            
<HTML>
<HEAD>
<meta name="booktitle" content="Developing Applications With Objective Caml" >
 <meta charset="ISO-8859-1"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<META name="GENERATOR" content="hevea 1.05-7 of 2000-02-24">
<META NAME="Author" CONTENT="Christian.Queinnec@lip6.fr">
<LINK rel=stylesheet type="text/css" href="videoc-ocda.css">
<script language="JavaScript" src="videoc.js"><!--
//--></script>
<TITLE>
 Introduction
</TITLE>
</HEAD>
<BODY class="regularBody">
<A HREF="book-ora158.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
<A HREF="book-ora160.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H2> Introduction</H2>This chapter illustrates program structure via two examples: the first 
uses a modular model; the second, an object model.<BR>
<BR>
The first application provides a set of parametric modules for two
player games. A functor implements the minimax-<FONT FACE=symbol>a</FONT><FONT FACE=symbol>b</FONT>
algorithm for the evaluation of a search tree. A second functor
allows modifying the human/machine interface for the game. These
parametric modules are then applied to two games: a vertical tic-tac-toe
game, and another involving the construction of mystic ley-lines.<BR>
<BR>
The second application constructs a world where robots evolve. The
world and robots are structured as classes. The different behaviors
of robots are obtained by inheritance from a common abstract class.
It is then easy to define new behaviors. There, too, the
human/machine interface may be modified.<BR>
<BR>
Each of the applications, in its structure, contains reusable
components. It is easy to construct a new two player game with
different rules that uses the same base classes. Similarly, the
general mechanism for the motion of robots in a world may be applied
to new types of robots.<BR>
<BR>
<BR>
<BR>
<HR>
<A HREF="book-ora158.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
<A HREF="book-ora160.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
